package com.multi.thread.chapter03.demo10;

public class Custom {
	
	private String lock;

	public Custom(String lock) {
		this.lock = lock;
	}
	
	public void getValue() {
		try {
			synchronized (lock) {
				while (ValueObject.value.equals("")) {
					System.out.println("消费者	" + Thread.currentThread().getName() + "	WAITTING了☆!");
					lock.wait();
				}
				System.out.println("消费者	" + Thread.currentThread().getName() + "	RUNNABLE了!");
				ValueObject.value = "";
				lock.notify();
			}
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
